﻿/***************
 * Copyright 2009 (C) 
 * Timur Fanshteyn
 * Blog: http://blog.tfanshteyn.com
 * ************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using System.Reflection;

namespace Coherence.Linq
{
    internal class ProjectionBuilder : CoherenceExpressionVisitor
    {
        internal ProjectionBuilder()
        {

            //if (miGetValue == null)
            //{

            //    miGetValue = typeof(ProjectionRow).GetMethod("GetValue");

            //}

        }

        internal LambdaExpression Build(Expression expression)
        {
            if (expression.NodeType == ExpressionType.Lambda)
                return (LambdaExpression)expression;
            else if (expression.NodeType == ExpressionType.Parameter)
            {
                return null;
            }
            else
            {
                throw new NotSupportedException("Not Supported Expression");
            }
        }
    }
}
